package com.sky.hutool;

import static org.junit.Assert.*;

import java.util.Calendar;
import java.util.Date;

import org.junit.Assert;
import org.junit.Test;

import com.xiaoleilu.hutool.convert.Convert;
import com.xiaoleilu.hutool.date.DateUtil;

/**
 * 
 *@Description: http://git.oschina.net/loolly/hutool
 *  http://www.hutool.cn/
 *@Author:hjt 
 *@Version:1.0.0
 */
public class H_Convert {

	@Test
	public void testType() throws Exception {
		int a = 1;
		long[] b = {1,2,3,4,5};

		String aStr = Convert.toStr(a);
		Assert.assertEquals("1", aStr);
		String bStr = Convert.toStr(b);
		Assert.assertEquals("[1, 2, 3, 4, 5]", Convert.toStr(bStr));
	}
	
	@Test
	public void testDateUtil() throws Exception {
		//当前时间
		Date date = DateUtil.date();
		//当前时间
		Date date2 = DateUtil.date(Calendar.getInstance());
		//当前时间
		Date date3 = DateUtil.date(System.currentTimeMillis());
		//当前时间字符串，格式：yyyy-MM-dd HH:mm:ss
		String now = DateUtil.now();
		//当前日期字符串，格式：yyyy-MM-dd
		String today= DateUtil.today();
	}
}
